package com.edu.app.service.impl.ai;

import com.edu.app.bean.core.SysUser;
import com.edu.app.bean.virtualbean.KeyValueItems;
import com.edu.app.bean.virtualbean.NameValueItems;
import com.edu.app.bean.virtualbean.customize.PoCustomerStatus;
import com.edu.app.bean.virtualbean.customize.SalesCommon;
import com.edu.app.bean.virtualbean.customize.SalesCustomerStatus;
import com.edu.app.bean.virtualbean.customize.SalesPerf;

import com.edu.app.mapper.ai.SysAISalesMapper;
import com.edu.app.model.customer.CustomerNotActiveModel;
import com.edu.app.model.customer.CustomerNotAssignedModel;
import com.edu.app.service.sys.ai.SysAISalesService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysAISalesServiceImpl implements SysAISalesService {
    @Autowired
    private SysAISalesMapper sysAISalesMapper;

    @Override
    public List<CustomerNotActiveModel> getNotActiveCustomerByUser(String username, Integer range){
        List<CustomerNotActiveModel> customerNotActiveModelList = sysAISalesMapper.getNotActiveCustomerByUser(username, range);
        return customerNotActiveModelList;
    }

    @Override
    public List<CustomerNotActiveModel> getNotActiveCustomer(Integer range){
        List<CustomerNotActiveModel> customerNotActiveModelList = sysAISalesMapper.getNotActiveCustomer(range);
        return customerNotActiveModelList;
    }

    @Override
    public List<KeyValueItems> getCustomerWithDemoClassToday(String username){
        List<KeyValueItems> customerWithDemoClassToday = sysAISalesMapper.getCustomerWithDemoClassToday(username);
        return customerWithDemoClassToday;
    }

    @Override
    public List<NameValueItems> getCustomerWithDemoClassFuture(String username){
        List<NameValueItems> customerWithDemoClassFuture = sysAISalesMapper.getCustomerWithDemoClassFuture(username);
        return customerWithDemoClassFuture;
    }

    @Override
    public NameValueItems getSalesDemoClassRank(String username){
        NameValueItems salesDemoClassRank = sysAISalesMapper.getSalesDemoClassRank(username);
        return salesDemoClassRank;
    }

    @Override
    public NameValueItems getSalesContractNumber(String username){
        NameValueItems salesContractNumber = sysAISalesMapper.getSalesContractNumber(username);
        return salesContractNumber;
    }

    @Override
    public NameValueItems getSalesContractTotalAmount(String username){
        NameValueItems salesContractTotalAmount = sysAISalesMapper.getSalesContractTotalAmount(username);
        return salesContractTotalAmount;
    }

    @Override
    public List<NameValueItems> getSalesDemoClassRankAllByDay(){
        List<NameValueItems> salesDemoClassRank = sysAISalesMapper.getSalesDemoClassRankAllByDay();
        return salesDemoClassRank;
    }

    @Override
    public List<NameValueItems> getSalesDemoClassRankAllByWeek(){
        List<NameValueItems> salesDemoClassRank = sysAISalesMapper.getSalesDemoClassRankAllByWeek();
        return salesDemoClassRank;
    }

    @Override
    public List<NameValueItems> getSalesDemoClassRankAllByMonth(){
        List<NameValueItems> salesDemoClassRank = sysAISalesMapper.getSalesDemoClassRankAllByMonth();
        return salesDemoClassRank;
    }

    @Override
    public List<NameValueItems> getSalesContractNumberAllByDay(){
        List<NameValueItems> salesContractNumber = sysAISalesMapper.getSalesContractNumberAllByDay();
        return salesContractNumber;
    }

    @Override
    public List<NameValueItems> getSalesContractNumberAllByWeek(){
        List<NameValueItems> salesContractNumber = sysAISalesMapper.getSalesContractNumberAllByWeek();
        return salesContractNumber;
    }

    @Override
    public List<NameValueItems> getSalesContractNumberAllByMonth(){
        List<NameValueItems> salesContractNumber = sysAISalesMapper.getSalesContractNumberAllByMonth();
        return salesContractNumber;
    }

    @Override
    public List<NameValueItems> getSalesContractTotalAmountAllByDay(){
        List<NameValueItems> salesContractTotalAmount = sysAISalesMapper.getSalesContractTotalAmountAllByDay();
        return salesContractTotalAmount;
    }

    @Override
    public List<NameValueItems> getSalesContractTotalAmountAllByWeek(){
        List<NameValueItems> salesContractTotalAmount = sysAISalesMapper.getSalesContractTotalAmountAllByWeek();
        return salesContractTotalAmount;
    }

    @Override
    public List<NameValueItems> getSalesContractTotalAmountAllByMonth(String date){
        List<NameValueItems> salesContractTotalAmount = sysAISalesMapper.getSalesContractTotalAmountAllByMonth(date);
        return salesContractTotalAmount;
    }

    @Override
    public PageInfo getMyCustomerModel(Integer currentPage, Integer pageSize, String orderBy, String sequence, String username, Integer status){

        PageHelper.startPage(currentPage, pageSize, true);
        List<SalesCustomerStatus> list = sysAISalesMapper.getMyCustomerModel(username, orderBy, sequence, status);

        PageInfo<SalesCustomerStatus> pageInfo = new PageInfo<SalesCustomerStatus>(list);
        return pageInfo;
    }

    @Override
    public PageInfo getAllPoCustomerModel(Integer currentPage, Integer pageSize, String orderBy, String sequence, Integer status){
        PageHelper.startPage(currentPage, pageSize, true);
        List<SalesCustomerStatus> list = sysAISalesMapper.getAllPoCustomerModel(orderBy, sequence, status);

        PageInfo<SalesCustomerStatus> pageInfo = new PageInfo<SalesCustomerStatus>(list);
        return pageInfo;
    }

    @Override
    public PageInfo getAllDemoClassPoCustomerModel(Integer currentPage, Integer pageSize, String orderBy, String sequence, Integer status){
        PageHelper.startPage(currentPage, pageSize, true);
        List<SalesCustomerStatus> list = sysAISalesMapper.getAllDemoClassPoCustomerModel(orderBy, sequence, status);

        PageInfo<SalesCustomerStatus> pageInfo = new PageInfo<SalesCustomerStatus>(list);
        return pageInfo;
    }

    @Override
    public PageInfo getPoCustomerModel(Integer currentPage, Integer pageSize, String orderBy, String sequence){

        PageHelper.startPage(currentPage, pageSize, true);
        List<PoCustomerStatus> list = sysAISalesMapper.getPoCustomerModel(orderBy, sequence);

        PageInfo<PoCustomerStatus> pageInfo = new PageInfo<PoCustomerStatus>(list);
        return pageInfo;
    }

    @Override
    public NameValueItems getActNumberByTypeAndMonth(String username, String type, String date){
        return sysAISalesMapper.getActNumberByTypeAndMonth(username, type, date);
    }

    @Override
    public NameValueItems getContractNumberByMonth(String username, String date){
        return sysAISalesMapper.getContractNumberByMonth(username, date);
    }

    @Override
    public NameValueItems getContractAmountByMonth(String username, String date){
        return sysAISalesMapper.getContractAmountByMonth(username, date);
    }

    @Override
    public NameValueItems getActNumberByTypeAndWeek(String username, String type, String date){
        return sysAISalesMapper.getActNumberByTypeAndWeek(username, type, date);
    }

    @Override
    public NameValueItems getContractNumberByWeek(String username, String date){
        return sysAISalesMapper.getContractNumberByWeek(username, date);
    }

    @Override
    public NameValueItems getContractAmountByWeek(String username, String date){
        return sysAISalesMapper.getContractAmountByWeek(username, date);
    }

    @Override
    public NameValueItems getActNumberByTypeAndDay(String username, String type, String date){
        return sysAISalesMapper.getActNumberByTypeAndDay(username, type, date);
    }

    @Override
    public NameValueItems getContractNumberByDay(String username, String date){
        return sysAISalesMapper.getContractNumberByDay(username, date);
    }

    @Override
    public NameValueItems getContractAmountByDay(String username, String date){
        return sysAISalesMapper.getContractAmountByDay(username, date);
    }

    @Override
    public NameValueItems getCusNumberByType(String username, Integer customer_type){
        return sysAISalesMapper.getCusNumberByType(username, customer_type);
    }

    @Override
    public List<SysUser> getSalesList(){
        return sysAISalesMapper.getSalesList();
    }

    @Override
    public List<SalesPerf> getSalesPerfByDay(String date){
        return sysAISalesMapper.getSalesPerfByDay(date);
    }

    @Override
    public List<SalesPerf> getSalesPerfByDayWithName(String date, String username){
        return sysAISalesMapper.getSalesPerfByDayWithName(date,username);
    }

    @Override
    public List<SalesCommon> getActNumberByTypeAndMonthAll(String date){
        return sysAISalesMapper.getActNumberByTypeAndMonthAll(date);
    }

    @Override
    public List<SalesPerf> getContractNumberAndAmountByMonthAll(String date){
        return sysAISalesMapper.getContractNumberAndAmountByMonthAll(date);
    }

    @Override
    public List<SalesCommon> getActNumberByTypeAndWeekAll(String date){
        return sysAISalesMapper.getActNumberByTypeAndWeekAll(date);
    }

    @Override
    public List<SalesPerf> getContractNumberAndAmountByWeekAll(String date){
        return sysAISalesMapper.getContractNumberAndAmountByWeekAll(date);
    }

    @Override
    public List<SalesCommon> getActNumberByTypeAndDayAll(String date){
        return sysAISalesMapper.getActNumberByTypeAndDayAll(date);
    }

    @Override
    public List<SalesPerf> getContractNumberAndAmountByDayAll(String date){
        return sysAISalesMapper.getContractNumberAndAmountByDayAll(date);
    }

    @Override
    public PageInfo getCustomerNotAssignedModel(Integer currentPage, Integer pageSize, String orderBy, String sequence){
        PageHelper.startPage(currentPage, pageSize, true);
        List<CustomerNotAssignedModel> list = sysAISalesMapper.getCustomerNotAssignedModel(orderBy, sequence);

        PageInfo<CustomerNotAssignedModel> pageInfo = new PageInfo<CustomerNotAssignedModel>(list);
        return pageInfo;
    }
}
